<?php
/* @var $this TicketController */
/* @var $model Ticket */

$this->breadcrumbs=array(
	'Tickets'=>array('index'),
	'Manage',
);
if ((Yii::app()->user->type==="Personnel")) {
$this->menu=array(
	array('label'=>'List', 'url'=>array('index')),
	//array('label'=>'Create', 'url'=>array('create')),
);
}else {
$this->menu=array(
        array('label'=>'List', 'url'=>array('index')),
        array('label'=>'Create', 'url'=>array('create')),
        );
        }

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#ticket-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Manage Tickets</h1>


<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'ticket-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'id',
		'ticket_name',
		'ticket_descript',
		'ticket_service_type',
		'effective_date',
		'demo_duration',
		
		'recommendation',
		//'employee_id',
		//'customer_business_id',
		//'customer_resident_id',
	array('name'=>'employee_id', 'header'=> 'Employee', 'value'=>'$data->employee->FullNameEmployee'),
		//array('name'=>'customer_business_id', 'header'=> 'Customer Business', 'value'=>'$data->customerBusiness->FullNameCustomer'),
		//array('name'=>'customer_resident_id', 'header'=> 'Customer Resident', 'value'=>'$data->customerResident->FullNameResident'),
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
